package com.yanghs.common.service.impl;

import com.yanghs.common.dao.HibernateDao;
import com.yanghs.common.entity.hbm.Userinfo;
import com.yanghs.common.service.IUserService;
import org.mybatis.spring.SqlSessionTemplate;

import javax.annotation.Resource;

/**
 * @author yanghs
 * @Description:
 * @date 2018/3/4 14:18
 */
public class UserService implements IUserService {
    //注入 SqlSessionTemplate
    @Resource(name = "sqlSessionTemplate")
    SqlSessionTemplate dao;
    //注入 hibernateDao
    @Resource(name = "hibernateDao")
    HibernateDao hibernateDao;

    /**
     *
     * @param userinfo
     * @return
     * @throws Exception
     */
    public Userinfo getUser(Userinfo userinfo) throws Exception {
        return hibernateDao.findObject(userinfo);
    }
}
